Skip to content

feat(deps): upgrade upstream dependencies#1581

Open
voidzero-guard[bot] wants to merge 9 commits into
mainfrom
deps/upstream-update
Open

feat(deps): upgrade upstream dependencies#1581
voidzero-guard[bot] wants to merge 9 commits into
mainfrom
deps/upstream-update

Conversation

@voidzero-guard
Copy link
Copy Markdown
Contributor

Summary

  • Automated daily upgrade of upstream dependencies.
  • Bumps rolldown to v1.0.1 and vite to v8.0.13; bumps vitest to 4.1.6 and the oxc family (oxc Rust crate, @oxc-project/*, oxc-minify/parser/transform, oxlint, oxfmt) to their latest releases.
  • Adjusts the rolldown pluginutils integration to follow upstream's relocation of @rolldown/pluginutils under packages/rolldown/node_modules/@rolldown/pluginutils and to its new .mjs / .d.mts exports.
  • Pins mimalloc-safe to =0.1.58 and bumps the nightly Rust toolchain to nightly-2026-03-15.

Dependency updates

Package From To
rolldown ac5c710 v1.0.1 (2777945)
vite 66f3194 v8.0.13 (a46f11a)
vitest 4.1.5 4.1.6
oxfmt 0.48.0 0.49.0
oxlint 1.63.0 1.64.0
oxc (Rust) 0.128.0 0.130.0
@oxc-project/runtime 0.129.0 0.130.0
@oxc-project/types 0.129.0 0.130.0
oxc-minify 0.129.0 0.130.0
oxc-parser 0.129.0 0.130.0
oxc-transform 0.129.0 0.130.0
@vitejs/devtools 0.1.21 0.1.23
Unchanged dependencies
  • tsdown: 0.22.0
  • @oxc-node/cli: 0.1.0
  • @oxc-node/core: 0.1.0
  • oxlint-tsgolint: 0.22.1

Code changes

  • packages/core/build.ts: update the rolldown pluginutils source path to the new nested packages/rolldown/node_modules/@rolldown/pluginutils location.
  • packages/tools/src/sync-remote-deps.ts: handle .mjs / .d.mts exports in transformPluginutilsExport, and look up pluginutils/package.json under the new nested path.
  • packages/core/package.json: switch ./rolldown/pluginutils and ./rolldown/pluginutils/filter exports to .mjs / .d.mts; bump @vitejs/devtools to ^0.1.23 and bundled vite / rolldown versions.
  • pnpm-workspace.yaml: add @rolldown/pluginutils: ^1.0.0 to the catalog and remove the workspace override for it; bump rolldown-plugin-dts to ^0.25.0, valibot to 1.4.0, vitepress-plugin-graphviz to ^0.1.0; update the vitest-dev override to npm:vitest@^4.1.6.
  • Cargo.toml: bump the oxc family of crates to 0.130.0; pin mimalloc-safe = "=0.1.58".
  • rust-toolchain.toml: bump nightly channel to nightly-2026-03-15.
  • packages/cli/snap-tests-global/command-staged-broken-config/snap.txt: refresh snapshot for the new oxc parser error formatting.
  • packages/tools/.upstream-versions.json, Cargo.lock, pnpm-lock.yaml: regenerated to match the new versions.

Build status

  • sync-remote-and-build: failure
  • build-upstream: failure

@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit d3d180e
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a06cb6331108900085d4237

@fengmk2 fengmk2 force-pushed the deps/upstream-update branch from 2d68398 to 8976c24 Compare May 15, 2026 03:52
voidzero-guard Bot and others added 6 commits May 15, 2026 14:37
- rolldown: ac5c710 -> v1.0.1 (2777945)
- vite: 66f3194 -> v8.0.13 (a46f11a)
- vitest: 4.1.5 -> 4.1.6
- oxfmt: 0.48.0 -> 0.49.0
- oxlint: 1.63.0 -> 1.64.0
- oxc (Rust): 0.128.0 -> 0.130.0
- @oxc-project/runtime: 0.129.0 -> 0.130.0
- @oxc-project/types: 0.129.0 -> 0.130.0
- oxc-minify: 0.129.0 -> 0.130.0
- oxc-parser: 0.129.0 -> 0.130.0
- oxc-transform: 0.129.0 -> 0.130.0
- @vitejs/devtools: 0.1.21 -> 0.1.23

Code changes:
- packages/core/build.ts: update rolldown pluginutils source path to read from `packages/rolldown/node_modules/@rolldown/pluginutils`.
- packages/tools/src/sync-remote-deps.ts: support `.mjs` / `.d.mts` exports when transforming pluginutils, and update the pluginutils package.json lookup path to match the new nested location.
- packages/core/package.json: switch `./rolldown/pluginutils` and `./rolldown/pluginutils/filter` exports to `.mjs` / `.d.mts`; bump bundled `vite`/`rolldown` versions.
- pnpm-workspace.yaml: add `@rolldown/pluginutils` catalog entry and drop its workspace override; bump `rolldown-plugin-dts` (^0.23 -> ^0.25), `valibot` (1.3.1 -> 1.4.0), `vitepress-plugin-graphviz` (^0.0.1 -> ^0.1.0); update `vitest-dev` override to `^4.1.6`.
- Cargo.toml: pin `mimalloc-safe = "=0.1.58"`.
- rust-toolchain.toml: bump nightly channel to `nightly-2026-03-15`.
- packages/cli/snap-tests-global/command-staged-broken-config/snap.txt: refresh snapshot for the new oxc parser error formatting (`Error: Unexpected token` -> `Unexpected token`).
- packages/tools/.upstream-versions.json, Cargo.lock, pnpm-lock.yaml: regenerated to match the new versions.
- collapsible_match: fold the bounds check into the KeyCode::Down match
  arm guard in vite_install package_manager
- unnecessary_sort_by: switch descending sorts in vite_js_runtime and
  vite_setup to sort_by_key with std::cmp::Reverse
- unnecessary_trailing_comma: drop trailing comma in a help.rs test
  assertion
bundleVitest copied vitest's distribution into packages/test/dist
without cleaning the directory first. When the upstream vitest
version changed, the new build emitted hashed chunks with new names
(e.g. cac.<new-hash>.js) but stale chunks from the previous version
lingered. The later brandVitest step iterates every cac.*.js chunk
looking for cac("vitest") and threw when it hit a stale chunk whose
pattern was absent or already rewritten, breaking pnpm bootstrap-cli.

Clear dist/ at the start of bundleVitest so each build starts from
a known-empty tree.
The npm-published rolldown@1.0.1 binding enables the mimalloc v3
feature (`crates/rolldown_binding/Cargo.toml` rolldown#9349), which
panics with `[internal exception] blocking task ran twice` in tokio
when tsdown drives rolldown through vp pack on darwin-arm64. The
result is that vp pack exits silently after "Build start", which
breaks every CLI snap test that bundles via vp pack (command-pack,
command-pack-exe, command-pack-external, command-pack-monorepo,
vp-cache-monorepo-missing, vp-pack-cache-disabled).

Force the binding download to use rolldown@1.0.0 while keeping the
1.0.1 JS sources (and the pluginutils relocation that depends on
them). The 1.0.0 binding is ABI-compatible with the surface vite-plus
exercises through tsdown/rolldown. Revert once an upstream rolldown
release ships without mimalloc v3 or fixes the panic.

The command-staged-broken-config snap.txt also rolls back to its
pre-PR form because the diagnostic prefix comes from the binding's
bundled oxc — `Error: Unexpected token` (1.0.0/oxc 0.128) vs.
`Unexpected token` (1.0.1/oxc 0.130).
Match the lighter-weight handling from #1569:

- packages/core/package.json: collapse the two pluginutils exports back
  to single .mjs strings. TypeScript already resolves a sibling .d.mts
  for an .mjs path under moduleResolution: bundler / node16, so the
  explicit `types` entries were redundant.
- packages/tools/src/sync-remote-deps.ts: drop the parallel .mjs
  branch in transformPluginutilsExport — once we stop wrapping string
  exports into objects, the matching `types` derivation isn't needed
  either.
- .github/actions/build-upstream/action.yml, justfile: drop the
  `pnpm --filter @rolldown/pluginutils build` step. Since rolldown
  moved pluginutils out of its workspace into a standalone npm
  package (rolldown/plugins), no workspace package matches that
  filter — the step was a silent no-op (`No projects matched the
  filters`).
The justfile's build recipe and the root package.json's build script
had drifted: the justfile knew it needed to build rolldown's native
binding, rolldown's JS, and vite's types before the @voidzero-dev/*
chain, while package.json's build only ran the @voidzero-dev/* +
vite-plus step. That meant pnpm bootstrap-cli (which calls pnpm build)
silently produced an incomplete tree on fresh checkouts — packages/
core/dist/vite/node/index.d.ts wouldn't exist, and vp check then
failed with TS7016 on every @voidzero-dev/vite-plus-core import.

Move the upstream prerequisites into the pnpm build script and have
the justfile recipe just call pnpm build, so the build sequence has a
single source of truth. CI is unaffected: bootstrap-cli:ci runs only
pnpm install-global-cli, and the per-target build-upstream action
keeps its own chain (it skips build-binding:release because the
binding is pulled from npm, and runs build-ts instead of build because
NAPI bindings are built and cached as a separate step).
@fengmk2 fengmk2 force-pushed the deps/upstream-update branch from ac85c38 to 289dc52 Compare May 15, 2026 06:37
The existing comment justifies using nightly at all (Z-bindeps and
windows_process_extensions_main_thread_handle), but a future
`feat(deps): upgrade upstream dependencies` PR bumps the date and
nobody remembers why. Add a note that the date itself is gated by
oxc_transformer >=0.130 using `if let` guards, which only stabilized
in rustc 1.94 (2026-01-29) — earlier nightlies fail with E0658.
Comment thread rust-toolchain.toml Outdated
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented May 15, 2026

Root cause of the macOS-only CI failure (and why a workaround was wrong)

TL;DR

It is not a tsdown/rolldown version mismatch — every layer is on the same 1.0.1. The CI snap-test failures on aarch64-apple-darwin are a real upstream regression in the rolldown 1.0.1 binding: enabling mimalloc v3 (rolldown/rolldown#9349) corrupts memory on macOS's default TLS model, and tokio is the visible victim with [internal exception] blocking task ran twice.

Version consistency — no drift anywhere

location rolldown JS binding sha256
rolldown/packages/rolldown/package.json 1.0.1
packages/core/dist/rolldown/.../bindingify-input-options-*.mjs var version = "1.0.1"
rolldown/packages/rolldown/src/rolldown-binding.darwin-arm64.node e932d68a…
rolldown/packages/rolldown/dist/rolldown-binding.darwin-arm64.node e932d68a…
packages/core/dist/rolldown/rolldown-binding.darwin-arm64.node e932d68a…
npm pack @rolldown/binding-darwin-arm64@1.0.1 e932d68a…

All four .node files are byte-identical to the npm-published 1.0.1 binding. rolldown-plugin-dts resolves to 0.25.0 everywhere. Tsdown is using the right rolldown.

Local reproducer

Same fixture (src/index.tsconsole.log), same Node.js, same binding (e932d68a…):

invocation result
import("rolldown").build({...}) ✅ works
import(".../packages/core/dist/rolldown/index.mjs").build({...}) ✅ works
import(".../node_modules/.pnpm/tsdown@0.22.0/.../dist/index.mjs").build({...}) ✅ works
import(".../packages/core/dist/tsdown/index.js").build({...}) ❌ EXIT 139, tokio panic

So rolldown@1.0.1 binding works in isolation; tsdown 0.22.0 (upstream) works with the same binding; only the combination of our bundled tsdown + the v1.0.1 binding crashes. Rebuilding the binding from source with the v3 feature removed (everything else identical) makes the crash go away.

Why macOS fails but Linux and Windows pass

CI ran the same snap shard on three targets; only macOS fails:

CLI snap test (aarch64-apple-darwin, 1..3/3): failure
CLI snap test (x86_64-unknown-linux-gnu, 1..3/3): success
CLI snap test (x86_64-pc-windows-msvc, 1..3/3): success

There are two separate reasons for the asymmetry:

Windows is a red herring — v3 isn't actually compiled there. libmimalloc-sys2's build.rs has two completely separate paths:

// Windows MSVC: cc::Build, source = c_src/mimalloc/src/static.c
if target_os == "windows" && target_env == "msvc" {
    build_mimalloc_win();
    return;
}
// Everything else: cmake::Config picks the source tree by feature flag
#[cfg(not(feature = "v3"))]
let mut cmake_config = Config::new("c_src/mimalloc");
#[cfg(feature = "v3")]
let mut cmake_config = Config::new("c_src/mimalloc3");

build_mimalloc_win() never checks CARGO_FEATURE_V3. It always builds v2 source. So the v3 feature flag is silently ignored on Windows. The real comparison is macOS vs Linux, both of which do compile c_src/mimalloc3.

macOS vs Linux differ in one feature — local_dynamic_tls. From rolldown/crates/rolldown_binding/Cargo.toml:

# macOS (and any other non-Linux/FreeBSD target)
mimalloc-safe = { features = ["skip_collect_on_exit", "v3"] }

# Linux x86_64
mimalloc-safe = { features = ["skip_collect_on_exit", "local_dynamic_tls", "v3"] }

# Linux aarch64
mimalloc-safe = { features = ["skip_collect_on_exit", "no_opt_arch", "local_dynamic_tls", "v3"] }

local_dynamic_tls is ELF-only — it sets MI_LOCAL_DYNAMIC_TLS=ON in cmake, which compiles mimalloc with -ftls-model=local-dynamic. That routes TLS accesses through __tls_get_addr with well-defined memory ordering. On macOS (Mach-O) it's not applicable, so the cargo cfg correctly omits it — but that leaves macOS on the default TLS model.

mimalloc v3's "reduce idle memory" change moved more allocator hot-path state into per-thread storage, making the TLS path significantly busier. On macOS's default TLS model inside a dlopen'd .node running on Node.js's worker thread pool, v3's per-thread segment cache stomps on memory it shouldn't. The visible victim is tokio's BlockingTask, which stores its closure in an Option<FnOnce> — when the discriminant byte gets clobbered, Option::take() succeeds the first poll and panics the second with blocking task ran twice.

target c_src/mimalloc3 compiled? local_dynamic_tls? result
macOS aarch64 yes no ❌ SIGSEGV
Linux x86_64 gnu yes yes
Windows MSVC no — Windows path never touches v3 source n/a

So Linux escapes via -ftls-model=local-dynamic. Windows escapes because v3 isn't even compiled. macOS gets the full v3 hot path on the unmitigated TLS model and corrupts memory.

Workaround reverted

60ae3def fix(ci): work around rolldown@1.0.1 binding tokio panic is reverted in b592d5f2. It was downgrading the binding to 1.0.0 while keeping the 1.0.1 JS, which is the wrong layering and would have hidden the real bug.

Proposed fix paths

  1. Upstream rolldown (preferred): drop v3 from the macOS target line in rolldown_binding/Cargo.toml, or add a macOS-suitable TLS-model flag to the cmake config. I can file an upstream issue with this writeup if it'd help.
  2. Hold this PR until rolldown ships 1.0.2 with the macOS v3 issue resolved. The PR is otherwise green on Linux/Windows.
  3. Patch in-tree as a temporary measure: apply a sed-style patch to the cloned rolldown source in CI to remove v3 from the macOS target line, then build the binding from source in the build-upstream action instead of downloading from npm. Adds ~2 min per macOS CI job; clean removal once upstream is fixed.

Happy to pursue any of these — let me know which direction.

The reviewer asked us to share a single nightly with voidzero-dev/
vite-task, whose rust-toolchain.toml is currently pinned to
nightly-2026-03-05. Match that and replace the date-rationale comment
with a directive that future bumps track the vite-task pin.

The earlier rationale (oxc_transformer >=0.130 needs `if_let_guard`,
stabilized in rustc 1.94 / 2026-01-29) is still satisfied — any
nightly past late January 2026 works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant